package com.hundredapp.oa.repository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.hundredapp.oa.dao.GenericDao;
import com.hundredapp.oa.domain.OaAction;

@Repository
public class ActionManagerImpl implements ActionManager {

	@Autowired
	private GenericDao<OaAction, Integer> actionDao;
	
	@Override
	public List<OaAction> findAll(String condition) {
		return actionDao.find(condition);
	}

	public void setActionDao(GenericDao<OaAction, Integer> actionDao) {
		this.actionDao = actionDao;
	}

	@Override
	public OaAction findById(int id) {
		return actionDao.findById(id);
	}

	@Override
	public List<OaAction> findAllLeaf(String condition) {
		return actionDao.find("leaf=1");		
	}

}
